<template>
  <div>
    <!-- 重定向组件通常不需要实际渲染内容 -->
  </div>
</template>

<script setup>
import { onBeforeMount } from 'vue'
import { useRoute, useRouter } from 'vue-router'

const route = useRoute()
const router = useRouter()

onBeforeMount(() => {
  const { params, query } = route
  const { path } = params
  
  // 处理路径并重定向
  router.replace({ path: '/' + path, query })
})
</script> 